import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TaskAddComponent } from './taskAdd/taskAdd';
import { TaskListComponent } from './taskList/taskList';

const routes: Routes = [
	{
		path: '',
		children: [
			{
				path: '',
				redirectTo: 'taskList',
			},
			{
				path: 'taskList',
				component: TaskListComponent,
				data: {
					title: '任务列表',
					url: 'taskMgmt/taskList',
				},
			},
			{
				path: 'taskAdd',
				component: TaskAddComponent,
				data: {
					title: '新建任务',
					url: 'taskMgmt/taskAdd',
				},
			},
		],
	},
];

@NgModule({
	imports: [RouterModule.forChild(routes)],
	exports: [RouterModule],
})
export class TaskMgmtRoutingModule {}
